package com.liusand.xo.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * @author LiuSha
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private boolean flag;
    private int code;
    private String message;
    private Object data;

    public static Result success(Object o){
        return new Result(true, 100,"success",o);
    }
    public static Result success(){
        return success(null);
    }
    public static Result error(){
        return new Result(false, -1,"error",null);
    }
    public static Result error(String message){
        return new Result(false, -1,message,null);
    }
}
